#include("/static/themes/default/layout/layout.html")
#@layout()
#define content()
  #carousels(isOverTime=true)
   #if(notEmpty(carousels))
    <div class="layui-carousel" id="test1" lay-filter="test1">
        <div carousel-item="">
            #for(carousel: carousels)
            <div><img src="#(carousel.imageUrl)" width="100%"></div>
            #end
        </div>
    </div>
   #end
  #end
    <div class="m-article-list">
        #articlePage(pageSize=10)
        #for(article: articlePage.data)
        <div class="m-article-box">
            <div class="m-article-container">
                <div class="m-article-title-box">
                    #if(article.isTop == 1)
                    <span class="layui-badge m-top">置顶</span>
                    #end
                    <a href="#(article.url)" class="m-article-title"><h2>#(article.title)</h2></a>
                </div>
                <div class="m-a-c">
                    #if(article.thumbnail != null && article.thumbnail != "")
                    <div class="m-article-img-box">
                        <div class="m-article-img" style="background-image: url('#(article.thumbnail)')"></div>
                    </div>
                    #end
                    <article class="m-article-content">#mdSummary(article.content,200)...</article>
                </div>
                <div class="m-article-info-box">
                    <div class="m-article-info-left">
                        <span class="m-article-info-btn"><i class="fa fa-user-o"></i> #(article.user.userName ??)</span>
                        <span class="m-article-info-btn"><i class="fa fa-clock-o"></i> #date(article.createTime, "yyyy年MM月dd日")</span>
                        <span class="m-article-info-btn"><i class="fa fa-eye"></i> #(article.viewCount ??)</span>
                        <span class="m-article-info-btn"><i class="fa fa-comment-o"></i> #(article.commentCount ??)</span>
                    </div>
                    <div class="m-article-info-right">
                        <a class="m-read-more" href="#(article.url)"><i class="fa fa-hand-o-right"></i> 阅读更多</a>
                    </div>
                </div>
            </div>
        </div>
        #else
        <div class="m-no-article">这里一篇文章都没有呢</div>
        #end
        #pageRender(articlePage, preText="上一页",nextText="下一页")
        #end
    </div>
#end
#define script()
    <script>
        layui.use(['carousel', 'form'], function(){
            var carousel = layui.carousel
            ,form = layui.form;

            //图片轮播
            carousel.render({
                elem: '#test1'
                ,width:'100%'
                ,height: '260px'
                ,interval: 3000
            });
        });
    </script>
#end
